const TokenKey = 'token'
const RefreshTokenKey = 'RefreshToken'
const UserName = 'name'
const UserRoles = 'roles'
const RouteToggle = 'RouteToggle'

export function getToken() {
  return localStorage.getItem(TokenKey)
}

export function setToken(token: string) {
  return localStorage.setItem(TokenKey, token)
}

export function removeToken() {
  return localStorage.removeItem(TokenKey)
}

export function setRefreshToken(RefreshToken: string) {
  return localStorage.setItem(RefreshTokenKey, RefreshToken)
}

export function removeRefreshToken() {
  return localStorage.removeItem(RefreshTokenKey)
}

export function setRouteToggle(routeIndex: string) {
  // debugger
  return localStorage.setItem(RouteToggle, routeIndex)
}

export function getRouteToggle() {
  return localStorage.getItem(RouteToggle)
}

export function getUserName() {
  return localStorage.getItem(UserName)
}

export function setUserName(name: string) {
  return localStorage.setItem(UserName, name)
}

export function removeUserName() {
  return localStorage.removeItem(UserName)
}

export function setUserRoles(roles: string) {
  return localStorage.setItem(UserRoles, roles)
}

export function removeUserRoles() {
  return localStorage.removeItem(UserRoles)
}